var exec = require('cordova/exec');

exports.add = function (arg0, arg1, success, error) {
    exec(success, error, 'ccrfidplugin', 'add', [arg0, arg1]);
}

exports.init = function (success, error) {
    exec(success, error, 'ccrfidplugin', 'init', []);
}

exports.openSerialPort = function (success, error) {
    exec(success, error, 'ccrfidplugin', 'openSerialPort', []);
}

exports.closeSerialPort = function (success, error) {
    exec(success, error, 'ccrfidplugin', 'closeSerialPort', []);
}

exports.scanWSDevice = function (success, error) {
    exec(success, error, 'ccrfidplugin', 'scanWSDevice', []);
}

exports.bindWSDevice = function (wsDeviceId, success, error) {
    exec(success, error, 'ccrfidplugin', 'bindWSDevice', [wsDeviceId]);
}

exports.unbindWSDevice = function (wsDeviceId, success, error) {
    exec(success, error, 'ccrfidplugin', 'unbindWSDevice', [wsDeviceId]);
}

exports.updateRangingFrequency = function (wsDeviceId, frequency, success, error) {
    exec(success, error, 'ccrfidplugin', 'updateRangingFrequency', [wsDeviceId, frequency]);
}

exports.setReaderToFree = function (success, error) {
    exec(success, error, 'ccrfidplugin', 'setReaderToFree', []);
}

exports.release = function (success, error) {
    exec(success, error, 'ccrfidplugin', 'release', []);
}
